package com.guge.sports.service.impl;

import com.guge.sports.entity.Cities;
import com.guge.sports.entity.StClass;
import com.guge.sports.mapper.StClassMapper;
import com.guge.sports.service.CitiesService;
import com.guge.sports.service.StClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guge.sports.toolPackage.base.BaseService;
import com.guge.sports.toolPackage.utils.MyPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-09-14
 */
@Service
public class StClassServiceImpl extends BaseService<StClass> implements StClassService {

    @Autowired
    private StClassMapper stClassMapper;


    @Override
    public MyPager<StClass> getClassList(MyPager<StClass> myPager, StClass stClass) {
        Integer count = stClassMapper.selectCount(null);
        System.out.println(count);

        myPager.setTotalCount(count);

        List<StClass> stClassMyPager = stClassMapper.getClassList(myPager,stClass);

       myPager.setList(stClassMyPager);
        return myPager;
    }

}
